package com.wachulski.marcin.msc.utils;

import com.wachulski.marcin.msc.pl.PLSystemKB;

import edu.isi.powerloom.Environment;
import edu.isi.powerloom.PLI;

public final class PLIRoutines {
	private PLIRoutines() {}
	
	public static void loadBasics(Environment env) {
		PLI.load(KBWarehouse.KB_BASIC_FOUNDATION.getFilePath(), env);
		PLI.load(KBWarehouse.KB_BASIC_SYSTEM.getFilePath(), env);
		PLI.load(KBWarehouse.KB_BASIC_BOUNDARY.getFilePath(), env);
	}
	
	public static void clearAll(Environment env) {
		PLI.clearCaches();
		PLI.sClearModule(KBWarehouse.KB_BASIC_BOUNDARY.getModulePath(), env);
		PLI.sClearModule(KBWarehouse.KB_BASIC_SYSTEM.getModulePath(), env);
		PLI.sClearModule(KBWarehouse.KB_BASIC_FOUNDATION.getModulePath(), env);
	}
	
	public static void loadSystem(PLSystemKB s, Environment env) {
		loadBasics(env);
		PLI.load(s.getFilePath(), env);
	}
}
